const {
  $util,
} = getApp();
Page({
  data: {
    showMore: false,
    imgUrl: $util.getImgUrl(),
  },
  onLoad(opts) {
    this.loadDetail(opts.id);
  },
  loadDetail(id) {
    $util.request({
      url: 'entry/wxapp/partyman.repunish.getRepunishDetail',
      data: {
        id,
      },
      success: (res) => {
        this.setData({
          detail: res.data,
        });
        wx.setNavigationBarTitle({
          title: res.data.rptype === '0' || res.data.rptype === '2' ? '荣誉详情' : '惩处详情',
        });
      },
    });
  },
  getMore() {
    this.setData({
      showMore: !this.data.showMore,
    });
  },
  onShow() {
    let wxData = wx.getStorageSync('qyUserInfo') || {};
    this.setData(wxData);
    this.setData({
      isSaaS: wx.getStorageSync('isSaaS'),
    });
  },
});
